﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NextCore;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using NextDraw;
namespace NextUI
{
    public class UITheme
    {
        public Tex2D ButForm = null;
        public Tex2D MouseNorm = null;
        public UITheme(string name)
        {
           // ButForm = new Tex2D("dat//ui//themes//" + name + "//ButForm.png");
        }

    }
    public class ColdBlue : UITheme
    {
        public ColdBlue() : base("ColdBlue")
        {
            
        }
    }
    public class UIApp : NextApp
    {
        public static UIApp A = null;
        public static UITheme Theme = null;
        public static Matrix4 DrawMat4;
        public UIApp(string app, bool full)
            : base(app, 800, 600, full)
        {
            Theme = new ColdBlue();
            A = this;
        }
        public override void InitModules()
        {
            Draw.InitDraw();
            Draw.W = Width;
            Draw.H = Height;
        }
        public override void SetupGL()
        {
            
       
            GL.Disable(EnableCap.DepthTest);
            GL.Disable(EnableCap.CullFace);
            ResizeApp();


        }
        public override void ResizeApp()
        {
            GL.Disable(EnableCap.Blend);
            GL.Disable(EnableCap.ScissorTest);
            GL.Disable(EnableCap.Texture2D);
            GL.Viewport(0, 0, Width, Height);
            Log.Log(LogType.Graphics, "W:" + Width + " H:" + Height,"",this as object,DateTime.Now);
         
            DrawMat4 = Matrix4.CreateOrthographicOffCenter(0, Width,Height,0, 0, 100.0f);
            Draw.DrawMat4 = DrawMat4;
        }
        public  void SetMat()
        {
           
     
        }

     
    }
}
